﻿using System.Security.Policy;
using System.Web.Mvc;
using System.Web.Routing;

namespace PhotoBlog
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
              name: "Slideshow",
              url: "slideshow",
              defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
              );

            routes.MapRoute(
                name: "Blog",
                url: "posts/{id}",
                defaults: new { controller = "Home", action = "Posts", id = UrlParameter.Optional }
                );

            routes.MapRoute(
                name: "AdminBlog",
                url: "admin/blog",
                defaults: new { controller = "Blog", action = "List", id = UrlParameter.Optional }
                );

            routes.MapRoute(
                name: "Request",
                url: "request",
                defaults: new { controller = "Request", action = "New" }
                );

            routes.MapRoute(
                name: "Requests",
                url: "admin/requests",
                defaults: new { controller = "Request", action = "Index" }
                );


            routes.MapRoute(
                name: "Error",
                url: "error",
                defaults: new { controller = "System", action = "Error" }
            );

            routes.MapRoute(
               name: "About",
               url: "about",
               defaults: new { controller = "Home", action = "About" }
           );

            routes.MapRoute(
                name: "DayPhoto",
                url: "day/{numberDay}",
                defaults: new { controller = "Home", action = "Photos", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "Album",
                url: "album/{id}/photos",
                defaults: new { controller = "Home", action = "Album", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "Albums",
                url: "albums/{id}",
                defaults: new { controller = "Home", action = "Albums", id = UrlParameter.Optional }
            );

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Photos", id = UrlParameter.Optional }
            );
        }
    }
}